<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位使用场景_压盖</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body{
            background: cyan;
        }
        div{
            width: 978px;
            height: 550px;
            margin: 20px auto;
            background: url(../img/1_1.jpg) no-repeat center top;
            position: relative;
        }
        p{
            width: 400px;
            height: 300px;
            background: #fff;
            position: absolute;
            top: 50%;
            left: 50%;
            line-height: 300px;
            text-align: center;
            margin-left: -200px;
            margin-top: -150px;
            border-radius: 8px;
            box-shadow: 5px 1px 3px 1px rgba(0,0,0,0.5);
        }
    </style>
</head>
<body>
    <div>
        <p>
            你好，欢迎来到我的世界！！！
        </p>
    </div>
</body>
</html>